/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.openmrs.module.basicmodule.DSS.Interpreter.Function;

import java.util.ArrayList;
import org.openmrs.module.basicmodule.DSS.Interpreter.InterpreterVisitor;
import org.openmrs.module.basicmodule.DSS.ast.AST;

/**
 *
 * @author Stephen
 */
public class IsFloatFunction extends Function {

    @Override
    public Object execute(ArrayList args) {
        Object var = ((AST) args.get(0)).accept(new InterpreterVisitor());
        String type = InterpreterVisitor.parseType(var.toString());
        if (type.equalsIgnoreCase("float")) {
            return true;
        } else {
            return false;
        }
    }
}
